package com.lx.idgenerator.config;

import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusPropertiesCustomizer;

import java.util.Properties;

/**
 * @author lX
 * @version JDK 8
 * @className MybatisPlusPropertiesCustomizer (此处以class为例)
 * @date 2024/11/9
 * @description TODO
 */
public class MpPropertiesCustomizer  implements MybatisPlusPropertiesCustomizer {


    private static final String typeAliasesPackage = "com.lx.idgenerator.model";

    private static final boolean mapUnderscoreToCamelCase = true;

    private static final boolean cacheEnabled = false;

    private static final String LOG_IMPL = "org.apache.ibatis.logging.stdout.StdOutImpl";

    private static final String[] mapperLocations = {"com.lx.idgenerator.mapper"};
    @Override
    public void customize(MybatisPlusProperties properties) {
        Properties customizeProperties = new Properties();
        customizeProperties.setProperty("map-underscore-to-camel-case", String.valueOf(mapUnderscoreToCamelCase));
        customizeProperties.setProperty("cache-enabled", String.valueOf(cacheEnabled));
        customizeProperties.setProperty("log-impl", LOG_IMPL);
        properties.setTypeAliasesPackage(typeAliasesPackage);
        properties.setConfigurationProperties(customizeProperties);
    }
}
